package com.andreams.restaurant.webservice;

import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Request;
import javax.ws.rs.core.UriInfo;

import com.andreams.restaurant.domain.Restaurant;
import com.andreams.restaurant.persistence.RestaurantDao;

@Path("/restaurants")
public class RestaurantsResource {

	@Context
	UriInfo uriInfo;
	@Context
	Request request;

	
	@GET
	@Produces(MediaType.APPLICATION_JSON)
	public List<Restaurant> getRestaurants(){
//		return RestaurantDao.getInstance().getRestaurants();
		return new RestaurantDao().getRestaurants();
	}
	
	@Path("{id}")
	public RestaurantResource getVideosLink(
			@PathParam("id") long id) {
		return new RestaurantResource(uriInfo, request, id);
	}
}
